﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
///DBConn 的摘要说明
/// </summary>
public class DBConn
{
    private static string con_emweb_new;
    public static string Con_emweb_new
    {
        get
        {
            if (string.IsNullOrEmpty(con_emweb_new))
            {
                con_emweb_new = System.Configuration.ConfigurationManager.ConnectionStrings["emweb_new"].ConnectionString;
                return con_emweb_new;
            }
            else
            {
                return con_emweb_new;
            }
        }
    }
    /// <summary>
    /// 得到web.config里配置项的数据库连接字符串。
    /// </summary>
    /// <param name="configName"></param>
    /// <returns></returns>
    public static string GetConnectionString(string configName)
    {
        string connectionString = System.Configuration.ConfigurationManager.AppSettings[configName];
        string ConStringEncrypt = System.Configuration.ConfigurationManager.AppSettings["ConStringEncrypt"];
        //if (ConStringEncrypt == "true")
        //{
        //    connectionString = DESEncrypt.Decrypt(connectionString);
        //}
        return connectionString;
    }

}